import time
from threading import Thread, Event

glb_evt = Event()


def print_info(name, char, n=None, interv=0.1, event_n=10, evt=None):
    i = 0
    while True:
        if n is not None:
            i += 1
            if i > n:
                break
            elif i >= event_n and evt is not None:
                evt.set()  # <<<<
        print(char, end='', flush=True)
        time.sleep(interv)
    print(f'{name} over.')


t1 = Thread(target=print_info, args=('t1', '1', 25, 0.1, 10, glb_evt))
t1.start()

glb_evt.wait()  # <<<<
print('From main.')
